package models

import (
	"gitee.com/sansaniot/ssiot-core/httpmvc/model"

	"ssnotify/common/dto"
	"ssnotify/internal/notify/models/query"
)

type NotifySender struct {
	Id    string `json:"id" gorm:"primaryKey;type:varchar(255);comment:配置id"`
	Value string `json:"value" gorm:"type:varchar(255);comment:配置值"`
	Title string `json:"title" gorm:"type:varchar(255);comment:字段名称"`

	model.Model
}

func (NotifySender) TableName() string {
	return "sys_notify_sender"
}

func (e *NotifySender) FindNotifySenderList(req *query.SysNotifySenderGetReq) (err error, list []NotifySender) {
	list = make([]NotifySender, 0)
	err = e.FindList(&list, dto.MakeCondition(req.GetNeedSearch()))
	return
}
